/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Jugadores.java
 *
 * Created on 04-dic-2011, 15:40:29
 */
package Vista;
import Modelo.Jugador;
/**
 *
 * @author Administrador
 */
public class Jugadores extends javax.swing.JFrame {

    /** Creates new form Jugadores */
    public Jugadores() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTablejugadores = new javax.swing.JTable();
        jButtonjugadores = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        getContentPane().setLayout(null);

        jTablejugadores.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null}
            },
            new String [] {
                "Cédula", "Nombre", "Apellido", "Nacimiento", "Posición", "Carreras", "Homeruns"
            }
        ));
        jScrollPane1.setViewportView(jTablejugadores);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(20, 120, 501, 275);

        jButtonjugadores.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        jButtonjugadores.setText("Cargar ");
        jButtonjugadores.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonjugadoresMouseClicked(evt);
            }
        });
        getContentPane().add(jButtonjugadores);
        jButtonjugadores.setBounds(400, 70, 83, 25);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24));
        jLabel1.setText(" Jugadores");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(220, 20, 144, 41);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-616)/2, (screenSize.height-438)/2, 616, 438);
    }// </editor-fold>//GEN-END:initComponents

private void jButtonjugadoresMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonjugadoresMouseClicked
// TODO add your handling code here:
  int Fila=0;  
  Jugador DatosJugador;
  
  while (Fila <  Jugador.ListaJugador.size())
   {
       DatosJugador=Jugador.ListaJugador.get(Fila);
            
     jTablejugadores.setValueAt(DatosJugador.getCedula(), Fila, 0);     
     jTablejugadores.setValueAt(DatosJugador.getNombre(), Fila, 1);  
     jTablejugadores.setValueAt(DatosJugador.getApellido(), Fila, 2);  
     jTablejugadores.setValueAt(DatosJugador.getFechaNac(), Fila, 3);  
     jTablejugadores.setValueAt(DatosJugador.getPosicion(), Fila, 4);  
     jTablejugadores.setValueAt(DatosJugador.getCarrerasImp(), Fila, 5);
     jTablejugadores.setValueAt(DatosJugador.getCuadrangulares(), Fila, 6);
                       
     Fila++;  
   }          
                                       
}//GEN-LAST:event_jButtonjugadoresMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Jugadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Jugadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Jugadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Jugadores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Jugadores().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonjugadores;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTablejugadores;
    // End of variables declaration//GEN-END:variables
}
